/* eslint-disable */
//paraName 等找参数的名称
function GetUrlParam(paraName) {
    var url = document.location.toString();
    var arrObj = url.split("?");
    if (arrObj.length > 1) {
        var arrPara = arrObj[1].split("&");
        var arr;
        for (var i = 0; i < arrPara.length; i++) {
            arr = arrPara[i].split("=");
            if (arr != null && arr[0] == paraName) {
                return arr[1];
            }
        }
        return "";
    }
    else {
        return "";
    }
}


const copy = text => {
    const textArea = document.createElement("textarea")
    textArea.style.position = 'fixed'
    textArea.style.top = 0
    textArea.style.left = 0
    textArea.style.border = 'none'
    textArea.style.outline = 'none'
    textArea.style.resize = 'none'
    textArea.style.background = 'transparent'
    textArea.style.color = 'transparent'
  
    textArea.value = text
    document.body.appendChild(textArea)
    textArea.select()
    try {
      const msg = document.execCommand('copy') ? 'successful' : 'unsuccessful'
      console.log(msg)
    } catch (err) {
      console.log('unable to copy', err)
    }
    document.body.removeChild(textArea)
  }

  window.GetUrlParam = GetUrlParam;
  window.copyTextToClipboard = copy;